﻿@model Provider.Models.Tool

@{
    ViewBag.Title = "Edit Tool";
}

<h2>@ViewBag.Title.</h2>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(model => model.ToolId)

    <div class="form-horizontal">
        @Html.ValidationSummary(true)

        <div class="form-group">
            @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Description, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Content, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Content, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Content)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
    
    <div>
        @Html.ActionLink("Back to List", "Index")
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/Scripts/tinymce/tinymce.min.js")
    <script type="text/javascript">
        tinymce.init({
            selector: '#Description',
            menubar: false,
            statusbar: false
        });
        tinymce.init({
            selector: '#Content',
            menubar: false,
            statusbar: false,
            height: 300
        });
    </script>
}
